
package net.swa.dewei.service;

import java.util.List;
import java.util.Map;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import net.swa.dewei.beans.entity.DingDan;
import net.swa.dewei.beans.vo.GroupAndMaxId;
import net.swa.util.JsonResult;

public interface DingDanService
{
    /**新增订单并返回订单id**/
    public String add(DingDan m);

    public DingDan addDingdan(final DingDan m);

    public void delete(Long[] ids);

    public boolean updateOrderStatus(Long id , String status);

    /**指派订单*/
    public boolean updateAssign(Long id , Long shopId);

    //    public JsonResult<DingDan> queryPage(String dingDanUid , String state , String changeType , User user , int currentPage , int pageSize);

    /**根据门店id查询待处理的订单*/
    public List<DingDan> queryMyDingdans(Long id);

    public void updateStatus(Long id , String state);

    /**根据服务站查询订单，若没有服务站查询全部(订单中含省市县)**/
    public JsonResult<DingDan> queryDingdansPage2(String customerName , String customerTel , String mendianName ,
            String dingDanUid , String state , String changeType , Long fuwuZhanId , int currentPage , int pageSize);

    /**更改订单状态*/
    public boolean updateState(DingDan model);

    /**定时任务***/
    public Boolean doTask();

    /**根据查询条件导出excel
     * @param fuwuZhanId **/
    public HSSFWorkbook exportExcel(String dingDanUid , String state , String changeType , Long fuwuZhanId);

    public Map<String, ?> queryGroup(Long fuwuzhanId);

    /**根据订单id查询订单**/
    public DingDan queryById(Long id);

    /**
     * 根据门店id和订单id查询订单（实际唯一）
     * @param id 门店id
     * @param dingDanUid 订单id
     * @return
     */
    public List<DingDan> queryMyDingdanByUuid(Long id , String dingDanUid);

    /**
     * 根据查询订单分页
     * @param customerName
     * @param customerTel
     * @param mendianName
     * @param dingDanUid
     * @param state
     * @param changeType
     * @param fuwuZhanId
     * @param fuwuzhanName
     * @param currentPage
     * @param pageSize
     * @return
     */
    public JsonResult<DingDan> queryDingdansPage3(String customerName , String customerTel , String mendianName ,
            String dingDanUid , String state , String changeType , Long fuwuZhanId , String fuwuzhanName ,
            int currentPage , int pageSize,String orderBy,String orderType);
    
    public GroupAndMaxId queryGroupMax(final Long fuwuzhanId , Long dingdanId,String state);
}